Method and Terminal for Keeping Subscriber Identity Module Card in Standby State

ABSTRACT

A method and a terminal device for keeping a subscriber identity module card in a standby state, where the method for keeping a subscriber identity module card in a standby state includes receiving, by a terminal device, an enabling request, where the enabling request is used for requesting simultaneous standby of a first subscriber identity module card and a second subscriber identity module card; invoking a third-party invocation interface provided by an operating system of the terminal device; performing interaction with a subscriber identity module card control module, so as to complete a network access process of the first subscriber identity module card on the basis of a data file of the first subscriber identity module card; and keeping the first subscriber identity module card and the second subscriber identity module card in a standby state at the same time according to the enabling request.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/591,819 filed on May 10, 2017, which claims priority to U.S. patentapplication Ser. No. 14/671,018 filed on Mar. 27, 2015, now U.S. Pat.No. 9,674,696, which claims priority to International Patent ApplicationNo. PCT/CN2013/076636 filed on Jun. 3, 2013, which claims priority toChinese Patent Application No. 201210374444.2 filed on Sep. 27, 2012.All of the afore-mentioned patent applications are hereby incorporatedby reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the field of communicationstechnologies, and in particular, to a method and a terminal device forkeeping a subscriber identity module card in a standby state.

BACKGROUND

A subscriber identity module (SIM) card is also called a smart card or asubscriber identification card. The SIM card stores content such asinformation about a digital mobile phone subscriber, an encrypted key,and a telephone directory of the subscriber in a computer chip. The SIMcard is a chip having a microprocessor and has five modules inside: acentral processing unit (CPU), a program storage, a work storage, a datastorage, and a serial communications unit; and the five modules areintegrated in an integrated circuit. The SIM card mainly has thefollowing functions.

(1) Storage of Subscriber-Related Data

Data stored in the SIM card may be classified into four types. A firsttype is fixedly stored data, and this type of data is written by a SIMcard center before a mobile equipment (ME) is sold, and includes aninternational mobile subscriber identification number (IMSI), anauthentication key (Ki), and the like; a second type is temporarilystored network-related data, such as a location area identification(LAI), a temporary mobile subscriber identity (TMSI), and a code for apublic telephone network forbidden to be accessed; a third type is arelated service code, such as a personal identification number (PIN), apin unblocking key (PUK), and a charging rate; and a fourth type is aphone directory, which includes a phone number entered by a mobile phonesubscriber at any time.

(2) Subscriber PIN Operation and Management

The SIM card is protected through a PIN, and the PIN is a personalpassword with four to eight digits. A SIM card can be enabled only whena subscriber enters a correct PIN, so that a mobile terminal can accessthe SIM card, and the subscriber can access a network and make a callonly after authentication of the PIN succeeds.

(3) Subscriber Identity Authentication

Subscriber identity authentication is implemented between a network andthe SIM card. When the authentication begins, the network generates a128-bit random number (Rand) and transmits the Rand through a radiocontrol channel to a mobile station, and the SIM card computes,according to the key Ki and an algorithm A3 in the card, a signedresponse (SRES) to the received Rand, and then sends the result to anetwork end. The network end finds out a key Ki of the subscriber in anauthentication center, computes an SRES using the same Rand andalgorithm A3, and compares the SRES with the received SRES. Ifconsistent, the authentication succeeds.

(4) Encryption Algorithms and Keys in the SIM Card

Most sensitive data in the SIM card includes encryption algorithms A3and A8 and keys Ki, PIN, PUK, and Kc. Algorithms A3 and A8 are writtenwhen a SIM card is produced and cannot be read. A PIN code can be set bya subscriber on a mobile phone, a PUK code is held by an operator, andKc is exported by Ki during an encryption process.

The SIM card is organized around a processor and includes the followingmemories.

(1) A read-only memory (ROM). The ROM is a program memory, has typicalcapacity of 16 thousand (K) bytes, and includes a development system ofthe SIM card, and the algorithms A3 and A8 (which may also be analgorithm A38) for dedicated use.

(2) An electrically erasable programmable read-only memory (EEPROM). TheEEPROM is a data memory and has typical capacity of 8K bytes. The EEPROMstores all normalized domains and related data for dedicated use in aglobal system of mobile communication (GSM).

(3) A random access memory (RAM). The RAM is a work memory. Capacity ofthe RAM may further be reduced and a typical value of the capacity ishundreds of bytes. The RAM includes related data for dedicated use.

The SIM card using the EEPROM can save information that is stored when amobile phone is powered off and retrieve the information when necessary.As long as a user keeps the SIM card properly, the same identity canstill be used even when the user changes a mobile phone.

A virtual SIM card technology is a technology in which an existinghardware SIM card is directly removed. A virtual SIM card refers to amanner in which a mobile network operator does not use a SIM card tobind a mobile phone number and a mobile terminal of a subscriber, butdirectly provides the mobile phone number.

However, the existing virtual SIM card technology supports standby ofonly one of a virtual SIM card and a hardware SIM card at a same time,but cannot support simultaneous standby of both the hardware SIM cardand the virtual SIM card. That is, if a mobile terminal adopts a virtualSIM card, a hardware SIM card in the mobile terminal will be disabled;and in this way, when a subscriber that uses the mobile terminal usesthe virtual SIM card, the subscriber cannot use the hardware SIM cardfor implementing a service, and cannot be contacted based on anidentifier of the hardware SIM card either, so that it is greatlyinconvenient for the subscriber to use the virtual SIM card.

SUMMARY

The present disclosure provides a method and a terminal device forkeeping a subscriber identity module card in a standby state, so as toimplement simultaneous standby of a subscriber identity module cardimplemented on the basis of hardware and a subscriber identity modulecard implemented on the basis of software in a terminal device.

In one aspect, the present disclosure provides a method for keeping asubscriber identity module card in a standby state, which includesreceiving, by a terminal device, an enabling request, where the enablingrequest is used for requesting simultaneous standby of a firstsubscriber identity module card and a second subscriber identity modulecard in the terminal device, the first subscriber identity module cardis implemented on the basis of software, and the second subscriberidentity module card is implemented on the basis of hardware; invoking,by the terminal device, a third-party invocation interface provided byan operating system of the terminal device; and performing interactionwith a subscriber identity module card control module in the terminaldevice through a subscriber identity module mobile equipment function ofthe third-party invocation interface, so as to complete a network accessprocess of the first subscriber identity module card on the basis of adata file of the first subscriber identity module card; and keeping, bythe terminal device, the first subscriber identity module card and thesecond subscriber identity module card in a standby state at the sametime according to the enabling request, where the second subscriberidentity module card has already accessed a network.

In another aspect, the present disclosure provides a terminal device,which includes a first subscriber identity module card interface moduleand a subscriber identity module card control module, where the firstsubscriber identity module card interface module is configured toreceive an enabling request, where the enabling request is used forrequesting simultaneous standby of a first subscriber identity modulecard and a second subscriber identity module card in the terminaldevice, the first subscriber identity module card is implemented on thebasis of software, and the second subscriber identity module card isimplemented on the basis of hardware; invoke a third-party invocationinterface provided by an operating system of the terminal device, so asto send the enabling request to the subscriber identity module cardcontrol module; and perform interaction with the subscriber identitymodule card control module through a subscriber identity module mobileequipment function of the third-party invocation interface, so as tocomplete a network access process of the first subscriber identitymodule card on the basis of a data file of the first subscriber identitymodule card; and the subscriber identity module card control module isconfigured to receive the enabling request sent by the first subscriberidentity module card interface module; and keep the first subscriberidentity module card and the second subscriber identity module card in astandby state at the same time according to the enabling request afterthe network access process of the first subscriber identity module cardis completed, where the second subscriber identity module card hasalready accessed a network.

Technical effects of the present disclosure are that after receiving anenabling request for requesting simultaneous standby of a firstsubscriber identity module card implemented on the basis of software anda second subscriber identity module card implemented on the basis ofhardware in a terminal device, the terminal device invokes a third-partyinvocation interface provided by an operating system of the terminaldevice; and performs interaction with a subscriber identity module cardcontrol module in the terminal device through a subscriber identitymodule mobile equipment function of the third-party invocationinterface, so as to complete a network access process of the firstsubscriber identity module card on the basis of a data file of the firstsubscriber identity module card. Therefore, it can be seen that thenetwork access process of the first subscriber identity module card iscompleted by interacting with the subscriber identity module cardcontrol module through the subscriber identity module mobile equipmentfunction of the third-party invocation interface without using aninterface between the second subscriber identity module card and thesubscriber identity module card control module, and the network accessprocess of the first subscriber identity module card does not influencea standby state of the second subscriber identity module card, so thatthe terminal device can keep the first subscriber identity module cardand the second subscriber identity module card in a standby state at thesame time according to the enabling request, where the second subscriberidentity module card has already accessed a network, therebyimplementing simultaneous standby of a subscriber identity module cardimplemented on the basis of hardware and a subscriber identity modulecard implemented on the basis of software in a terminal device. In thisway, even if the terminal device uses the subscriber identity modulecard implemented on the basis of software, the subscriber identitymodule card implemented on the basis of hardware in the terminal deviceis kept in the standby state at the same time and is not disabled, sothat a subscriber of the terminal device can still use the subscriberidentity module card implemented on the basis of hardware forimplementing a service, and can still be contacted through thesubscriber identity module card implemented on the basis of hardware,thereby facilitating use of the subscriber.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments. Theaccompanying drawings in the following description show only someembodiments of the present disclosure, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a flow chart of a method for keeping a subscriber identitymodule card in a standby state according to an embodiment of the presentdisclosure;

FIG. 2 is a schematic structural diagram of a terminal device accordingto an embodiment of the present disclosure;

FIG. 3 is a schematic structural diagram of a terminal device accordingto another embodiment of the present disclosure;

FIG. 4 is a schematic diagram of a first SIM card management interfaceaccording to an embodiment of the present disclosure;

FIG. 5 is a schematic diagram of an interface between a SIM card controlmodule and a first SIM card interface module according to an embodimentof the present disclosure; and

FIG. 6 is a schematic structural diagram of a SIM card control moduleaccording to an embodiment of the present disclosure.

DETAILED DESCRIPTION

To make the objectives, technical solutions, and advantages of theembodiments of the present disclosure more comprehensible, the followingclearly describes the technical solutions in the embodiments of thepresent disclosure with reference to the accompanying drawings in theembodiments of the present disclosure. The embodiments to be describedare only a part rather than all of the embodiments of the presentdisclosure. All other embodiments obtained by a person of ordinary skillin the art based on the embodiments of the present disclosure withoutcreative efforts shall fall within the protection scope of the presentdisclosure.

FIG. 1 is a flow chart of a method for keeping a subscriber identitymodule card in a standby state according to an embodiment of the presentdisclosure. As shown in FIG. 1, the method for keeping a subscriberidentity module card in a standby state may include the following steps.

Step 101: A terminal device receives an enabling request, where theenabling request is used for requesting simultaneous standby of a firstsubscriber identity module card and a second subscriber identity modulecard in the terminal device, where the first subscriber identity modulecard is implemented on the basis of software, and the second subscriberidentity module card is implemented on the basis of hardware.

That the terminal device receives an enabling request may include thatthe terminal device receives an enabling request for a first subscriberidentity module card selected by a subscriber that uses the terminaldevice, where the enabling request is used for requesting simultaneousstandby of a second subscriber identity module card and the firstsubscriber identity module card selected by the subscriber that uses theterminal device.

Step 102: The terminal device invokes a third-party invocation interfaceprovided by an operating system of the terminal device; and performsinteraction with a subscriber identity module card control modulethrough a subscriber identity module mobile equipment function of thethird-party invocation interface, so as to complete a network accessprocess of the first subscriber identity module card on the basis of adata file of the first subscriber identity module card.

In an embodiment, the third-party invocation interface is provided bythe operating system of the terminal device on the basis of a driver.That is, the operating system and the third-party invocation interfaceare based on a hardware driver. In an embodiment, the subscriberidentity module card control module is a hardware chip, and interactswith the operating system through a driver.

The completing a network access process of the first subscriber identitymodule card on the basis of a data file of the first subscriber identitymodule card may be receiving, by the terminal device, an authenticationrequest sent by a network side device, reading key information in thedata file of the first subscriber identity module card, generatingauthentication information according to the read key information, andsending the authentication information to the network side device tocomplete the network access process of the first subscriber identitymodule card.

Step 103: The terminal device keeps the first subscriber identity modulecard and the second subscriber identity module card in a standby stateat the same time according to the enabling request, where the secondsubscriber identity module card has already accessed a network.

Further, after the terminal device starts up and before step 103, theterminal device still needs to perform interaction with the secondsubscriber identity module card to complete a network access process ofthe second subscriber identity module card. The terminal device mayreceive an authentication request sent by the network side device, readkey information in a data file of the second subscriber identity modulecard, generate authentication information according to the read keyinformation, and send the authentication information to the network sidedevice to complete the network access process of the second subscriberidentity module card.

In this embodiment, the terminal device performs interaction with thefirst subscriber identity module card and the second subscriber identitymodule card through different interfaces, and therefore, the networkaccess process and the standby state of the first subscriber identitymodule card do not influence the standby state of the second subscriberidentity module card.

In this embodiment, the data file of the first subscriber identitymodule card is stored in the terminal device, or the data file of thefirst subscriber identity module card is stored in an external storagedevice connected to the terminal device.

In this embodiment, the data file of the first subscriber identitymodule card may be stored in an internal flash memory or a securedigital memory card (SD) of the terminal device, or may be stored in anexternal storage device connected to the terminal device. The externalstorage device may be connected to the terminal device in a manner suchas a universal serial bus (USB), near field communication (NFC),Bluetooth®, or wireless fidelity (WIFI), and in this case, the terminaldevice needs to support reading of content in the data file of the firstsubscriber identity module card in the external storage device in amanner such as a USB, NFC, Bluetooth®, or WIFI.

In this embodiment, the data file of the first subscriber identitymodule card is encrypted and saved. The terminal device may read theencrypted data file of the first subscriber identity module cardaccording to a predefined rule and a predefined path, and a decryptionkey required for decrypting the encrypted data file of the firstsubscriber identity module card is provided by the network side device,so as to ensure security of information in the data file of the firstsubscriber identity module card.

In the foregoing embodiment, after receiving an enabling request forrequesting simultaneous standby of a first subscriber identity modulecard implemented on the basis of software and a second subscriberidentity module card implemented on the basis of hardware in a terminaldevice, the terminal device invokes a third-party invocation interfaceprovided by an operating system of the terminal device; and performsinteraction with a subscriber identity module card control modulethrough a subscriber identity module mobile equipment function of thethird-party invocation interface, so as to complete a network accessprocess of the first subscriber identity module card on the basis of adata file of the first subscriber identity module card. Therefore, itcan be seen that the network access process of the first subscriberidentity module card is completed by interacting with the subscriberidentity module card control module through the subscriber identitymodule mobile equipment function of the third-party invocation interfacewithout using an interface between the second subscriber identity modulecard and the subscriber identity module card control module, and thenetwork access process of the first subscriber identity module card doesnot influence a standby state of the second subscriber identity modulecard, so that the terminal device can keep the first subscriber identitymodule card and the second subscriber identity module card in a standbystate at the same time according to the enabling request, where thesecond subscriber identity module card has already accessed a network,thereby implementing simultaneous standby of a subscriber identitymodule card implemented on the basis of hardware and a subscriberidentity module card implemented on the basis of software in theterminal device. In this way, even if the terminal device uses thesubscriber identity module card implemented on the basis of software,the subscriber identity module card implemented on the basis of hardwarein the terminal device is kept in the standby state at the same time andis not disabled, so that a subscriber that uses the terminal device canstill use the subscriber identity module card implemented on the basisof hardware for implementing a service, and can still be contactedthrough the subscriber identity module card implemented on the basis ofhardware, thereby facilitating use of the subscriber.

The subscriber identity module card in the embodiment shown in FIG. 1 ofthe present disclosure may be a SIM card in a GSM system, and may alsobe a universal subscriber identity module (USIM) card in a universalmobile telecommunications system (UMTS), and a form of the subscriberidentity module card is not limited in the present disclosure.

A person of ordinary skill in the art may understand that all or a partof the steps of the foregoing method embodiments of the presentdisclosure may be implemented by a program instructing relevanthardware. The program may be stored in a computer readable storagemedium. When the program is run, the steps of the foregoing methodembodiments are performed. The storage medium may be any medium that iscapable of storing program codes, such as a ROM, a RAM, a magnetic disk,or an optical disc.

FIG. 2 is a schematic structural diagram of a terminal device accordingto an embodiment of the present disclosure. The terminal device in thisembodiment can implement a procedure of the embodiment shown in FIG. 1of the present disclosure. As shown in FIG. 2, the terminal device 2 mayinclude a first subscriber identity module card interface module 21 anda subscriber identity module card control module 22, where the firstsubscriber identity module card interface module 21 is configured toreceive an enabling request, where the enabling request is used forrequesting simultaneous standby of a first subscriber identity modulecard and a second subscriber identity module card in the terminaldevice, the first subscriber identity module card is implemented on thebasis of software, and the second subscriber identity module card isimplemented on the basis of hardware; invoke a third-party invocationinterface provided by an operating system of the terminal device, so asto send the enabling request to the subscriber identity module cardcontrol module 22; and perform interaction with the subscriber identitymodule card control module 22 through a subscriber identity modulemobile equipment function of the third-party invocation interface, so asto complete a network access process of the first subscriber identitymodule card on the basis of a data file of the first subscriber identitymodule card; and the subscriber identity module card control module 22is configured to receive the enabling request sent by the firstsubscriber identity module card interface module 21; and keep the firstsubscriber identity module card and the second subscriber identitymodule card in a standby state at the same time according to theenabling request after the network access process of the firstsubscriber identity module card is completed, where the secondsubscriber identity module card has already accessed a network.

In an embodiment, the third-party invocation interface is provided bythe operating system of the terminal device on the basis of a driver.That is, the operating system and the third-party invocation interfaceare based on a hardware driver. In an embodiment, the subscriberidentity module card control module is a hardware chip, and interactswith the operating system through a driver.

In this embodiment, that the first subscriber identity module cardinterface module 21 is configured to perform interaction with thesubscriber identity module card control module 22 through the subscriberidentity module mobile equipment function of the third-party invocationinterface, so as to complete the network access process of the firstsubscriber identity module card on the basis of the data file of thefirst subscriber identity module card may be that the first subscriberidentity module card interface module 21 is configured to receive anauthentication request from a network side device, where theauthentication request is sent by the subscriber identity module cardcontrol module 22, and the authentication request is sent by thesubscriber identity module card control module 22 to the firstsubscriber identity module card interface module 21 through thesubscriber identity module mobile equipment function of the third-partyinvocation interface; read key information in the data file of the firstsubscriber identity module card; generate authentication informationaccording to the read key information; and send the authenticationinformation to the subscriber identity module card control module 22through the subscriber identity module mobile equipment function of thethird-party invocation interface, so that the subscriber identity modulecard control module 22 sends the authentication information to thenetwork side device to complete the network access process of the firstsubscriber identity module card.

Further, the subscriber identity module card control module 22 isfurther configured to, after the terminal device starts up, performinteraction with the second subscriber identity module card to completea network access process of the second subscriber identity module card.The subscriber identity module card control module 22 may receive anauthentication request sent by the network side device, read keyinformation in a data file of the second subscriber identity modulecard, generate authentication information according to the read keyinformation, and send the authentication information to the network sidedevice to complete the network access process of the second subscriberidentity module card.

Further, the terminal device 2 may further include a first subscriberidentity module card management module 23, where the first subscriberidentity module card management module 23 is configured to send anenabling request for a first subscriber identity module card selected bya subscriber that uses the terminal device to the first subscriberidentity module card interface module 21.

In this embodiment, that the first subscriber identity module cardinterface module 21 is configured to receive the enabling request may bethat the first subscriber identity module card interface module 21 isconfigured to receive the enabling request for the first subscriberidentity module card selected by the subscriber that uses the terminaldevice, where the enabling request is sent by the first subscriberidentity module card management module 23, and the enabling request isused for requesting simultaneous standby of the second subscriberidentity module card and the first subscriber identity module cardselected by the subscriber that uses the terminal device.

In this embodiment, the terminal device performs interaction with thefirst subscriber identity module card and the second subscriber identitymodule card through different interfaces, and therefore, the networkaccess process and the standby state of the first subscriber identitymodule card do not influence the standby state of the second subscriberidentity module card.

In this embodiment, the data file of the first subscriber identitymodule card is stored in the terminal device, or the data file of thefirst subscriber identity module card is stored in an external storagedevice connected to the terminal device.

In this embodiment, the data file of the first subscriber identitymodule card may be stored in an internal flash memory or an SD card ofthe terminal device, or may be stored in an external storage deviceconnected to the terminal device. The external storage device may beconnected to the terminal device in a manner such as a USB, NFC,Bluetooth®, or WIFI, and in this case, the first subscriber identitymodule card interface module 21 needs to support reading of content inthe data file of the first subscriber identity module card in theexternal storage device in a manner such as a USB, NFC, Bluetooth®, orWIFI.

In this embodiment, the data file of the first subscriber identitymodule card is encrypted and saved. The first subscriber identity modulecard interface module 21 may read the encrypted data file of the firstsubscriber identity module card according to a predefined rule and apredefined path, and a decryption key required for decrypting theencrypted data file of the first subscriber identity module card isprovided by the network side device, so as to ensure security ofinformation in the data file of the first subscriber identity modulecard.

In the foregoing terminal device, in the network access process of thefirst subscriber identity module card, the first subscriber identitymodule card interface module 21 implements interaction with thesubscriber identity module card control module 22 through the subscriberidentity module mobile equipment function of the third-party invocationinterface without using an interface between the second subscriberidentity module card and the subscriber identity module card controlmodule 22. Therefore, the network access process of the first subscriberidentity module card does not influence the standby state of the secondsubscriber identity module card, so that the subscriber identity modulecard control module 22 can keep the first subscriber identity modulecard and the second subscriber identity module card in the standby stateat the same time according to the enabling request, where the secondsubscriber identity module card has already accessed the network,thereby implementing simultaneous standby of a subscriber identitymodule card implemented on the basis of hardware and a subscriberidentity module card implemented on the basis of software in theterminal device. In this way, even if the terminal device uses thesubscriber identity module card implemented on the basis of software,the subscriber identity module card implemented on the basis of hardwarein the terminal device is kept in the standby state at the same time andis not disabled, so that a subscriber that uses the terminal device canstill use the subscriber identity module card implemented on the basisof hardware for implementing a service, and can still be contactedthrough the subscriber identity module card implemented on the basis ofhardware, thereby facilitating use of the subscriber.

The subscriber identity module card in the embodiment shown in FIG. 2may be a SIM card in a GSM system, and may also be a USIM card in a UMTSsystem, and a form of the subscriber identity module card is not limitedin the present disclosure, but in the following description ofembodiments of the present disclosure, that a subscriber identity modulecard is a SIM card is taken as examples for description.

FIG. 3 is a schematic structural diagram of a terminal device accordingto another embodiment of the present disclosure. As shown in FIG. 3, theterminal device 3 may include a SIM card control module 31, a first SIMcard interface module 32, a second SIM card 33, and a first SIM cardmanagement module 34, where the second SIM card 33 is implemented on thebasis of hardware and a first SIM card is implemented on the basis ofsoftware.

In addition, the terminal device 3 may further include a baseband module35 and a radio frequency module 36.

The SIM card control module 31 is a logical function module thatconnects the baseband module 35 and the second SIM card 33, and in apractical application, the SIM card control module 31 and the basebandmodule 35 are generally integrated in a baseband chip. An interfacebetween the SIM card control module 31 and the second SIM card 33 is aSIM mobile equipment (SIM-ME) interface. In the present disclosure, afunctional interaction interface between the SIM card control module 31and the first SIM card management module 34 and a functional interactioninterface between the SIM card control module 31 and the first SIM cardinterface module 32 exist, so as to support simultaneous standby of thefirst SIM card and the second SIM card.

The first SIM card management module 34 is configured to provide a firstSIM card management interface in the terminal device for a subscriberthat uses the terminal device. Through the management interface, thesubscriber may choose to download, enable, and/or disable the first SIMcard. When the subscriber chooses to enable the first SIM card, thefirst SIM card management module 34 sends an enabling request for thefirst SIM card to the first SIM card interface module 32.

The first SIM card interface module 32 is configured to manage a datafile of the first SIM card downloaded from a network side, implement aninterface function with the SIM card control module 31, and implement afunction such as an encryption algorithm required for invoking theinterface, and is responsible for security of use of the first SIM card.

The data file of the first SIM card refers to a static data part in thefirst SIM card, such as a key Ki, an IMSI, and an integrated servicesdigital network (ISDN). The data file of the first SIM card is generallyencrypted and saved, and the first SIM card interface module 32 readscontent of the encrypted data file of the first SIM card according to apredefined rule and a predefined path, and a decryption key required fordecrypting the encrypted data file of the first subscriber identitymodule card is provided by a network side device, so as to ensuresecurity of information in the data file of the first SIM card.

In this embodiment, the data file of the first SIM card may be stored inan internal flash memory or an SD card of the terminal device 3, or maybe stored in an external storage device connected to the terminal device3. The external storage device may be connected to the terminal devicein a manner such as a USB, NFC, Bluetooth®, or WIFI, and in this case,the first SIM card interface module 32 needs to support reading ofcontent in the data file of the first SIM card in the external storagedevice in a manner such as a USB, NFC, Bluetooth®, or WIFI.

In this embodiment, the first SIM card interface module 32 and the datafile of the first SIM card form the first SIM card. The first SIM cardinterface module 32 is an application running on the terminal device andsupports encryption algorithms A3 and A8; but for a third generationmobile communications system (3G) network, a function defined in a USIMsuch as network authentication further needs to be supported on thebasis of a GSM SIM card. The data file of the first SIM card is thestatic data part, which includes an IMSI and/or a key, and the like.

In order to implement simultaneous standby of the first SIM card and thesecond SIM card, the first SIM card interface module 32 further needs toimplement an interface with the first SIM card management module 34 andthe interface with the SIM card control module 31; and support enablingof the first SIM card and disabling of the first SIM card, and support afirst SIM card management interface, such as charging policy settinginterface.

In this embodiment, the first SIM card is formed by the first SIM cardinterface module 32 and the data file of the first SIM card. To downloadthe first SIM card, the two parts may be downloaded successively or maybe downloaded simultaneously. When downloading the first SIM card, thesubscriber may download application software of the first SIM cardinterface module 32 from an application store. The first SIM cardinterface module 32 is a basic capability of the first SIM card, and theapplication software of the first SIM card interface module 32 is notdifferent for data files of first SIM cards of different operators.Therefore, when the subscriber selects a certain wireless networkoperator in a roaming area, the subscriber only needs to download, fromthe operator, a data file of a first SIM card corresponding to theoperator, and choose to enable the first SIM card in the first SIM cardmanagement interface provided by the first SIM card management module34, so as to implement a function of the first SIM card in collaborationwith the first SIM card interface module 32.

In this embodiment, manners of downloading the data file of the firstSIM card may include the following.

(1) Downloading over the air (OTA), where in a manner such as twodimensional barcode scanning, a server deployed by the operator of thefirst SIM card is triggered to push the data file to be downloaded.

(2) In a manner such as a short message or unstructured supplementaryservice data (USSD), a server deployed by the operator of the first SIMcard is triggered to push the data file to be downloaded.

(3) Downloading by visiting a web page or through payment.

In this embodiment, the first SIM card management interface provided bythe first SIM card management module 34 may be as shown in FIG. 4. FIG.4 is a schematic diagram of a first SIM card management interfaceaccording to an embodiment of the present disclosure.

When a subscriber of the terminal device chooses a certain first SIMcard, such as a first SIM card 1 shown in FIG. 4, to be enabled, thefirst SIM card management module 34 sends an enabling request for thefirst SIM card 1 to the first SIM card interface module 32, and afterenabling of the first SIM card is completed, the first SIM cardinterface module 32 notifies the first SIM card management module 34that the enabling is successful.

If the subscriber of the terminal device chooses a certain first SIMcard on the interface shown in FIG. 4 to be disabled, for example, if afirst SIM card 2 is disabled, the first SIM card management module 34sends a disabling request for the first SIM card 2 to the first SIM cardinterface module 32, to notify the first SIM card interface module 32that the first SIM card 2 is disabled.

In specific implementation, the first SIM card interface module 32 andthe first SIM card management module 34 may be implemented in oneprogram.

In this embodiment, the first SIM card interface module 32 serves as anapplication program running in the operating system of the terminaldevice. The application software of the first SIM card interface module32 may be downloaded from an application store, or may be downloadedfrom a network in another manner, and a manner for downloading theapplication software of the first SIM card interface module 32 is notlimited in the present disclosure.

The existing SIM card control module 31 supports simultaneous standby ofat least two SIM cards, where the at least two SIM cards are generallySIM cards implemented on the basis of hardware. If it is required thatthe SIM card control module 31 supports simultaneous standby of a SIMcard implemented on the basis of software and a SIM card implemented onthe basis of hardware, a problem that the SIM card control module 31switches from a hardware interface to a software interface needs to besolved, and the software interface is provided by the first SIM cardinterface module 32.

A manner for implementing the interface between the SIM card controlmodule 31 and the first SIM card interface module 32 may be as shown inFIG. 5. FIG. 5 is a schematic diagram of an interface between a SIM cardcontrol module and a first SIM card interface module according to anembodiment of the present disclosure.

In practical deployment, the SIM card control module 31 may be anindependent chip or a function module in a chip where the basebandmodule 35 is located. The operating system (for example, Android®, oriOS®) of the terminal device implements communication with the SIM cardcontrol module 31 through a driver, and the operating system of theterminal device provides the third-party invocation interface, forexample, a radio interface layer (RIL) interface on the basis of thedriver. In order to implement simultaneous standby of the first SIM cardand the second SIM card, in an interface I1 shown in FIG. 5, invocationof a SIM-ME function in the RIL interface needs to be implemented, andthe RIL interface is notified that the SIM-ME function is enabled, sothat the first SIM card can be normally identified and used by the SIMcard control module 31.

In this embodiment, the following functions need to be added to the RILinterface.

(1) Function of enabling, disabling, and/or deleting the first SIM card.

(2) SIM-ME function, including a data management interface (for example,reading and adding a contact) and subscriber identity authentication(functions such as Second Generation (2G) network access authentication,3G network access authentication, and authentication performed by a 3Gterminal device for a network).

In this embodiment, the SIM card control module 31 has a capability ofsimultaneously using the interface I1 and an interface I2 to invoke thefirst SIM card interface module 32 and the second SIM card 33, andtherefore, simultaneous standby of the first SIM card and the second SIMcard can be implemented. FIG. 6 is a schematic structural diagram of aSIM card control module according to an embodiment of the presentdisclosure.

As shown in FIG. 6, the SIM card control module 31 includes a first SIMcard management interface 311 and a second SIM card management interface312, so as to support simultaneous intercommunication with the first SIMcard and the second SIM card. In addition, the SIM card control module31 may further include a SIM card management logic 313.

If the SIM card control module 31 is integrated in the chip where thebaseband module 35 is located, modifications made to the driver and theRIL interface by the operating system are modifications made to the chipwhere the baseband module 35 is located.

For a terminal device in which the SIM card control module 31 or thechip where the baseband module 35 is located cannot meet a newrequirement, the driver is updated through the first SIM card interfacemodule 32. In the updated driver, the SIM card management logic 313 andthe second SIM card management interface 312 inside the SIM card controlmodule 31 are hijacked, so that the SIM card management logic 313invokes an interface in the first SIM card rather than an interface inthe second SIM card, thereby implementing standby of the first SIM card.However, by adopting this solution, standby of only one SIM card (eitherthe first SIM card or the second SIM card) can be implemented. In thisscenario, choice of enabling the SIM card implemented on the basis ofhardware or the SIM card implemented on the basis of software can bemade in the first SIM card management interface, and a subscriber maychoose to enable the SIM card implemented on the basis of software orthe SIM card implemented on the basis of hardware through the first SIMcard management interface. Only one of the two SIM cards can be chosento be enabled.

The following introduces interaction processes of various modules in theembodiment shown in FIG. 3.

After a subscriber that uses the terminal device operates on the firstSIM card management interface to choose to enable a specific first SIMcard, for example, the first SIM card 1, the first SIM card managementmodule 34 sends, according to the choice of the subscriber, an enablingrequest for the first SIM card 1 to the first SIM card interface module32, to request simultaneous standby of the first SIM card 1 and thesecond SIM card. The first SIM card is implemented on the basis ofsoftware, and the second SIM card is implemented on the basis ofhardware.

The first SIM card interface module 32 invokes the third-partyinvocation interface, for example, a RIL interface, provided by theoperating system of the terminal device on the basis of the driver, andsends the enabling request to the SIM card control module 31.

Then the SIM card control module 31 sends an authentication request fromthe network side device to the first SIM card interface module 32, wherethe authentication request is sent by the SIM card control module 31 tothe first SIM card interface module 32 through the SIM-ME function ofthe third-party invocation interface; and then, the first SIM cardinterface module 32 reads encryption information in a data file of thefirst SIM card 1, generates authentication information according to theread key information, and sends the authentication information to theSIM card control module 31 through the SIM-ME function of thethird-party invocation interface, so that the SIM card control module 31sends the authentication information to the network side device tocomplete a network access process of the first SIM card 1.

If a network is a 3G network or a long term evolution (LTE) network,optionally, the terminal device also needs to execute an authenticationprocess of the network, so as to ensure that the terminal deviceaccesses a trusted network expected by the subscriber that uses theterminal device.

After the network access process of the first SIM card 1 is completed,the SIM card control module 31 keeps the first SIM card 1 in a standbystate.

In addition, after the terminal device starts up, the SIM card controlmodule 31 further performs interaction with the second SIM card 33 tocomplete a network access process of the second SIM card 33. The SIMcard control module 31 may receive an authentication request sent by thenetwork side device, read key information in a data file of the secondSIM card 33, generate authentication information according to the readkey information, and send the authentication information to the networkside device to complete the network access process of the second SIMcard 33.

At last, the SIM card control module 31 keeps the first SIM card 1 andthe second SIM card 33 in a standby state at the same time according tothe enabling request.

In addition, after simultaneous standby of the SIM card implemented onthe basis of software and the SIM card implemented on the basis ofhardware is implemented, it is not defined that a subscriber chooseswhich SIM card to initiate a service such as network access and callmaking, so that a SIM card of a higher priority may be chosen accordingto a specific policy set by a subscriber, an operator, or a terminaldevice. For example, if the subscriber in roaming enables a SIM cardimplemented on the basis of software in a roaming area, during a roamingperiod, the SIM card implemented on the basis of software ispreferentially used for a service initiated by the subscriber, so as toreduce roaming fees of the subscriber.

With the method and the terminal device for keeping a subscriberidentity module card in a standby state provided in the presentdisclosure, simultaneous standby of a SIM card implemented on the basisof hardware and a SIM card implemented on the basis of software in aterminal device can be implemented, so that a subscriber canconveniently choose an appropriate SIM card to initiate a service whenroaming, thereby effectively solving a problem of SIM card use when thesubscriber is roaming, and reducing a production cost of a SIM card, sothat, the SIM card implemented on the basis of software is appliedefficiently.

A person skilled in the art may understand that the accompanyingdrawings are only schematic diagrams of an exemplary embodiment, and themodules or procedures in the accompanying drawings are not necessarilyindispensable in implementing the present disclosure.

A person skilled in the art may understand that the modules in theapparatus provided in the embodiments may be arranged in the apparatusin a distributed manner according to the description of the embodiments,or may be changed and arranged in one or a plurality of apparatuses thatare different from those described in the embodiments. The modules inthe foregoing embodiments may be combined into one module, or may besplit into a plurality of sub-modules.

Finally, it should be noted that the foregoing embodiments are onlyintended for describing the technical solutions of the presentdisclosure rather than limiting the present disclosure. Although thepresent disclosure is described in detail with reference to theforegoing embodiments, a person of ordinary skill in the art shouldunderstand that modifications may still be made to the technicalsolutions described in the foregoing embodiments, or equivalentreplacements may still be made to some or all of the technical featuresthereof; however, these modifications or replacements do not make theessence of corresponding technical solutions depart from the scope ofthe technical solutions in the embodiments of the present disclosure.

What is claimed is:
 1. A method, comprising: accessing, by a terminaldevice, a first network via a first subscriber identity module (SIM)card implemented on a basis of hardware in the terminal device;receiving, by the terminal device, an enabling request, the enablingrequest enabling standby of a second SIM card implemented on a basis ofsoftware; and performing, by the terminal device, a second networkaccess process of the second SIM card based on a third-party interfaceon a basis of an operating system of the terminal device.
 2. The methodof claim 1, further comprising displaying, by the terminal device, auser interface comprising information associated with the second SIMcard and a button configured to switch on or off the second SIM card. 3.The method of claim 2, wherein the information associated with thesecond SIM card comprises region information of the terminal device. 4.The method of claim 1, wherein the third-party interface comprises aradio interface layer (RIL) interface.
 5. The method of claim 1, whereinthe operating system comprises an ANDROID system.
 6. The method of claim1, further comprising receiving, by the terminal device, a selectingoperation from a user of the terminal device.
 7. The method of claim 6,further comprising displaying, by the terminal device, a buttonassociated with the selecting operation.
 8. The method of claim 1,further comprising downloading, by the terminal device, a data fileassociated with the first SIM card from a network service provider.
 9. Aterminal device, comprising: a memory comprising instructions; and aprocessor coupled to the memory, the instructions causing the processorto be configured to: access a first network by a first subscriberidentity module (SIM) card implemented on a basis of hardware in theterminal device; receive an enabling request, the enabling requestenabling standby of a second SIM card implemented on a basis ofsoftware; and perform a second network access process of the second SIMcard based on a third-party interface on a basis of an operating systemof the terminal device.
 10. The terminal device of claim 9, wherein theinstructions further cause the processor to be configured to display auser interface comprising information associated with the second SIMcard and a button configured to turn on or turn off the second SIM card.11. The terminal device of claim 10, wherein the information associatedwith the second SIM card comprises region information of the terminaldevice.
 12. The terminal device of claim 9, wherein the third-partyinterface comprises a radio interface layer (RIL) interface.
 13. Theterminal device of claim 9, wherein the operating system comprises anANDROID system.
 14. The terminal device of claim 9, wherein theinstructions further cause the processor to be configured to receive aselecting operation from a user of the terminal device.
 15. The terminaldevice of claim 14, wherein the instructions further cause the processorto be configured to display a button associated with the selectingoperation.
 16. The terminal device of claim 9, wherein the instructionsfurther cause the processor to be configured to download a data fileassociated with the first SIM card from a network service provider.